<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<script type="text/javascript">
  	
    $(document).ready(function () {
        $("#submitbutton").click(function () {
            var options = {
                url: 'exitlogin.action',
                type: 'post',
                dataType: 'text',
                success: function (responsedata) {
                    //if (responsedata.length > 0)
                       // $("#responseText").text(responsedata);
                    $('#myModal').modal('show');
                    if(responsedata=="5"){//退出成功
                    	 function jump(count) { 
                			window.setTimeout(function(){ 
                    			count--; 
                    			if(count > 0) { 
                       				$("#printcontent").html("<p class='bg-success'>退出成功，将在"+count+"秒后刷新</p>"); 
                        			jump(count); 
                    			} else { 
                        			location.href="p_index.action"; 
                    			} 
                			}, 1000); 
           				 } 
            		jump(3); 
                    }
                    else{
                    	$("#printcontent").html("<p class='bg-danger'>退出失败</p>");
                    }
                }
            };
            $.ajax(options);
            return false;
        });
    });
  	
  </script>
<div class="container">
<div class="modal fade" id="myModal"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
   				<div class="modal-dialog">
      				<div class="modal-content">
         				<div class="modal-header">
            				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                  					×
            				</button>
            				<h4 class="modal-title" id="myModalLabel">提示</h4>
       					</div>
         				<div class="modal-body" id="printcontent"></div>
         				<div class="modal-footer">
            				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
         				</div>
      				</div><!-- /.modal-content -->
				</div><!-- /.modal -->
			</div>		
			<!----top-header---->
			<div class="top-header">
				<div class="logo">
					<a href="p_index.action"><img src="${pageContext.request.contextPath}/images/logo.png" title="barndlogo" /></a>
				</div>
				<div class="top-header-info">
					<div class="top-contact-info">
						<ul class="unstyled-list list-inline">
							<li><span class="phone"> </span>400-800-1234567</li>
							<li><span class="mail"> </span><a href="#">1234567@qq.com</a></li>
							<div class="clearfix"> </div>
						</ul>
					</div>
					<div class="cart-details">
						<div class="add-to-cart">
							<ul class="unstyled-list list-inline">
								<li><span class="cart"> </span>
									<ul class="cart-sub">
										<li><p>0 Products</p></li>
									</ul>
								</li>
							</ul>
						</div>
						<div class="login-rigister">
							<ul class="unstyled-list list-inline">
							<s:if test="#session.user==null">
								<li><a class="login" href="p_login.action">登录</a></li>
								<li><a class="rigister" href="p_regist.action">注册 <span> </span></a></li>
								<div class="clearfix"> </div>
							</s:if>
							<s:if test="#session.user!=null">
							<li>
							 <div class="dropdown">
   <button type="button" class="btn dropdown-toggle" id="dropdownMenu1" 
      data-toggle="dropdown">
      <s:property value="#session.user.ualais"/>
      <span class="caret"></span>
   </button>
   <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
      <li role="presentation">
         <a role="menuitem" tabindex="-1" href="p_userpanel.action">用户中心</a>
      </li>
      <li role="presentation">
         <a role="menuitem" tabindex="-1" id="submitbutton">注销</a>
      </li>
      <li role="presentation">
         <a role="menuitem" tabindex="-1" href="#">
            待定
         </a>
      </li>
      <li role="presentation" class="divider"></li>
      <li role="presentation">
         <a role="menuitem" tabindex="-1" href="#">待定</a>
      </li>
   </ul>
</div>
</li>
<li><a class="rigister" href="#">待定 <span> </span></a></li>
<li><a class="rigister" href="#">待定 <span> </span></a></li>
            </s:if>
							</ul>
						</div>
						<div class="clearfix"> </div>
					</div>
				</div>
				<div class="clearfix"> </div>
			</div>
			<!----//top-header---->
			<!---top-header-nav---->
			<div class="top-header-nav"> 
			<!----start-top-nav---->
			 <nav class="top-nav main-menu">
					<ul class="top-nav">
						<li><a href="products.html">商品 </a><span> </span></li>
						<li><a href="products.html">公司</a><span> </span></li>
						<li><a href="products.html">服务</a><span> </span></li>
						<li><a href="products.html">品牌</a><span> </span></li>
						<li><a href="products.html">关于我们</a></li>
						<div class="clearfix"> </div>
					</ul>
					<a href="#" id="pull"><img src="${pageContext.request.contextPath}/images/nav-icon.png" title="menu" /></a>
			  </nav>
			  <!----End-top-nav---->
			  <!---top-header-search-box--->
			  <div class="top-header-search-box">
			  	<form>
			  		<input type="text" placeholder="Search" required  maxlength="22">
			  		<input type="submit" value=" " >
			  	</form>
			  </div>
			  <!---top-header-search-box--->
						<div class="clearfix"> </div>
			</div>
		</div>